
<script>
	import store from "./store";
    import $util from "./common/util";
    import $routesConfig from "./config/routes.config";

    export default {
        methods:{
            async getSessionId(){
                let res = await this.$apis.getSessionId();
                uni.setStorageSync('sessionId', res.data.session_id);
            },
            async getLoadMessage(){  //查询用户是否有新的消息提示
                if(store.state.token!==''){ //已登录并且会员已实名采取查询是否有新消息
                    let resData=  await  this.$apis.loadMessage({access_token:'',no_loading:1})
                    if(resData.code==0){
                        if(resData.data.model.content!==''){ //查询到有新的消息
                            uni.showModal({
                                title: "提示",
                                content: '转让成功',
                                confirmText: "确认",
                                showCancel:false,
                                success(res) {
                                }
                            })
                        }
                    }
                }


            }
        },
        created () {
            // let token = uni.getStorageSync('token');
            this.getSessionId();
            // if(token){
            //   this.checkToken()
            // }

            // setInterval(() => {
            //     this.getLoadMessage()
            // }, 5000)
        },
		onLaunch: function() {
			/* console.log("onLaunch")
			uni.getUserInfo({
				success(res){
					console.log(res)
				}
			}) */
			/* uni.getSetting({
				success(res){
					console.log(res)
					if(!res.authSetting['scope.record']){
						uni.authorize({
							scope:'scope.record',
							success(){
								console.log("jin")
							},
							fail(err){
								console.log(err)
							}
						})
					}
				}
			}) */

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData:{
			mediaStatus:uni.getSystemInfoSync().statusBarHeight
		},
	}
</script>

<style>
	/*每个页面公共css */
	@import "/wxcomponents/vant/dist/common/index.wxss";
</style>
